home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple Developer Connection Student Program
/
ADC Tools Sampler CD Disk 3 1999.iso
/
Cool Demos, SDKs, & Tools
/
Demos⁄Tools⁄Offers
/
Alpha ƒ
/
Tcl
/
Packages
/
printerChoices.tcl
< prev
next >
Wrap
Text File
|
1998-04-12
|
2KB
|
82 lines
## -*-Tcl-*- (install)
# ###################################################################
# Alpha - new Tcl folder configuration
#
# FILE: "printerChoices.tcl"
# created: 13/9/97 {2:30:36 pm}
# last update: 04/12/98 {17:54:26 PM}
#
# Reorganisation carried out by Vince Darley with much help from Tom
# Fetherston, Johan Linde and suggestions from the Alpha-D mailing list.
# Alpha is shareware; please register with the author using the register
# button in the about box.
#
# Description:
#
# This package converts the basic 'Print…' menu item into a sub-menu
# from which the user can select a variety of printing methods.
# This used to be part of standard Alpha, but it seemed a good
# candidate to split off into a package.
# ###################################################################
##
alpha::extension printerChoicesMenu 0.2 {
menu::buildProc print setupPrintMenu
menu::replaceWith File "/P<Sprint…" submenu print
}
newPref var defaultPrinter "Alpha" global setupPrintMenu \
{Alpha Kodex Enscriptor {Drop•PS} PrettyC}
lunion varPrefs(Printer) defaultPrinter
proc setupPrintMenu {args} {
global defaultPrinter
set m [list {/P<SPrint…} {/P<S<I<OPrint All…} "\(-" \
Alpha Kodex Enscriptor {Drop•PS} PrettyC]
Menu -m -n print -p menu::print $m
foreach item $m {
if {$item == $defaultPrinter} {
markMenuItem -m print $item on
} else {
markMenuItem -m print $item off
}
}
}
proc menu::print {menu item} {
global modifiedVars defaultPrinter
switch -glob $item {
"Print All" {
if {$defaultPrinter == "Alpha"} {
printAll
} else {
foreach f [winNames -f] {
printFile $f
}
}
}
"Print" {
printFile [win::Current]
}
default {
set defaultPrinter $item
lappend modifiedVars defaultPrinter
setupPrintMenu
}
}
}
proc printFile {fname} {
global defaultPrinter
switch -glob $defaultPrinter {
"Alpha" {print}
"Kodex*" {openAndSendFile KoDX}
"Enscr*" {openAndSendFile Ens3}
"Drop*" {openAndSendFile {D•PS}}
"Pret*" {openAndSendFile niCe}
}
}